---
category: Validator
created: '2020-05-05'
title: Check if a date is today
updated: '2021-10-13'
---

**JavaScript version**

```js isToday.js
// `date` is a Date object
const isToday = (date) => date.toISOString().slice(0, 10) === new Date().toISOString().slice(0, 10);
```

**TypeScript version**

```ts isToday.ts
const isToday = (date: Date): boolean => date.toISOString().slice(0, 10) === new Date().toISOString().slice(0, 10);
```
